/*
 * config.h
 *
 *  Created on: 2008-8-13
 *      Author: fanliangliang
 */

#ifndef CONFIG_H_
#define CONFIG_H_

// platform detect
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__)
#define PLATFORM_WIN32
#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(linux) || defined(__linux) || defined(__linux__)
#define PLATFORM_POSIX
#endif

// namespace define
#define BEGIN_NAMESPACE_TOXIC namespace toxic {
#define END_NAMESPACE_TOXIC }

// class uncopyable
#define CLASS_UNCOPYABLE(classname) \
private: \
	classname(const classname&); \
	classname& operator=(const classname&);

template <typename T, int N>
char (&dimension_helper(T (&)[N]))[N];

// calculate the demension of a unary array
#define dimension_of(x) (sizeof(dimension_helper(x)))

// using multithreaded singleton
#define SAFE_SINGLETON

typedef unsigned char byte;

#endif /* CONFIG_H_ */
